Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Android support attempt #372

Merged
merged 1 commit into from
Apr 13, 2021
Merged

Initial Android support attempt #372

merged 1 commit into from
Apr 13, 2021

Conversation

io12
Copy link
Contributor

@io12 io12 commented Apr 12, 2021

I've been trying to port Box86 to Android to run the x86 Android version of Wine. I've gotten pretty far and it mostly works now, but wineboot fails with an internal error. It would be great if you could look over this PR and see if there are any obvious problems with it.

CMake flags:

cmake .. -DARM_DYNAREC=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DANDROID=1 -DNOLOADADDR=1 -DANDROID_ABI=armeabi-v7a -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk/build/cmake/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=28 -DHAVE_TRACE=1

Wine version used: https://dl.winehq.org/wine-builds/android/wine-6.5-x86.apk

Normal log:

~/box86/build $ BOX86_DYNAREC=0 PATH=$PATH:~/wine/assets/x86/bin ./box86t wine wineboot
Box86 with trace with Dynarec v0.2.1 9d090bc5 built on Apr 12 2021 11:01:19
Box86 with trace with Dynarec v0.2.1 9d090bc5 built on Apr 12 2021 11:01:19
Box86 with trace with Dynarec v0.2.1 9d090bc5 built on Apr 12 2021 11:01:19
0024:err:environ:run_wineboot failed to start wineboot c00000e5
Warning, accessing segment NULL
11135|SIGSEGV @0xad3d85ac (???(/data/data/com.termux/files/home/box86/build/box86t/0xad3d85ac)) (x86pc=0xf5059cdb//data/data/com.termux/files/home/wine/assets/x86/bin/../lib/wine/ntdll.so:"???", esp=0xf491df80, stack=0xf411f000:0xf491f000 own=0x0 fp=0xf491e284), for accessing 0x1f8 (code=1/prot=0), db=0x0(0x0:0x0/0x0:0x0/???:clean, hash:0/0)
11135|Double SIGSEGV (code=1, pc=0xad3d85ac, addr=0x1f8)!

Log with WINEDEBUG=+all:
log1.txt

Log with WINEDEBUG=+all BOX86_LOG=2:
log2.txt

Copy link
Owner

@ptitSeb ptitSeb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen nothing obvious in the trace not in the code for now. I did a few comment, check them please.

CMakeLists.txt Outdated Show resolved Hide resolved
@@ -368,6 +371,13 @@ set(WRAPPEDS
"${BOX86_ROOT}/src/wrapped/wrappedldlinux.c"
"${BOX86_ROOT}/src/wrapped/wrappedcrashhandler.c"
)
if(NOT ANDROID)
set(WRAPPEDS
"${BOX86_ROOT}/src/wrapped/wrappedlibjpeg.c"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libjpeg is used by wine, so thisone will need to be added at some point

src/wrapped/gnulib_qsort.c Outdated Show resolved Hide resolved
@@ -138,7 +138,7 @@ GO("libtiff.so.5", libtiff)

#ifdef ANDROID
GO("libc.so", libc)
GO("libm.so", libc)
GO("libm.so", libm)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, that will help things!

@io12
Copy link
Contributor Author

io12 commented Apr 13, 2021

It looks like wine 6.3 works with Dynarec off! (I only tested cmd.exe because I don't think the downloadable Android wine builds use X11) I'm not sure why newer versions of wine fail to start wineboot or why Dynarec causes SIGILL, but it's progress.

@ptitSeb
Copy link
Owner

ptitSeb commented Apr 13, 2021

Ok, thanks. Is it ready to merge or do you still have some stuff you want to do before?

@io12
Copy link
Contributor Author

io12 commented Apr 13, 2021

I think it's ready. I squashed the commits so the gnulib file isn't in the history.

@ptitSeb ptitSeb merged commit 4a780af into ptitSeb:master Apr 13, 2021
@io12 io12 deleted the android branch May 3, 2021 14:11
@io12 io12 mentioned this pull request Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants